package cn.xfdzx.android.apps.shop.adapter;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

import cn.xfdzx.android.apps.shop.R;

/**
 * @author gzk
 * @date 2020/3/31 0031
 * description：
 */
public class VideoVPAdapter extends FragmentPagerAdapter {
    private FragmentManager manager;
    private String[] title;
    private List<Fragment> list;
    private Context mContext;
    public VideoVPAdapter(FragmentManager fm, String[] title, List<Fragment> list, Context context) {
        super(fm);
        this.manager = fm;
        this.title = title;
        this.list = list;
        this.mContext = context;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }


    @Override
    public int getCount() {
        return list.size();
    }




    public View getTabView(int position) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_vp_text, null);
        TextView tv_title=view.findViewById(R.id.tv_title);
        tv_title.setText(title[position]);

        return view;
    }
}
